// JavaScript Document
// tabledeleterow.js version 1.2 2006-02-21
// mredkj.com

// CONFIG notes. Below are some comments that point to where this script can be customized.
// Note: Make sure to include a <tbody></tbody> in your table's HTML

var INPUT_NAME_PREFIX = 'inputName'; // this is being set via script
var RADIO_NAME = 'totallyrad'; // this is being set via script
var TABLE_NAME = 'tblSample'; // this should be named in the HTML
var ROW_BASE = 1; // first number (for display)
var hasLoaded = false;
var curr_row = 0;
window.onload=fillInRows2;

function fillInRows(numrows)
{
	var i;
	hasLoaded = true;
	if (document.getElementById && document.getElementsByTagName) {		
		var tbl = document.getElementById(TABLE_NAME);
		var l = tbl.rows.length;	
		if(l > 1){
			delallrow(tbl, l);
		}
		if(numrows){			
			i = 0;
			while(i<numrows){
				addRowToTable2(null,'','','','','','','','');			
				i++;				
			}
		}
	}
}
function fillInRows2(){
	hasLoaded = true;
}
// CONFIG:
// myRowObject is an object for storing information about the table rows
function myRowObject(one, two, three, four, five, six, seven, eight, nine, ten)
{		
	this.one = one; // text object
	this.two = two; // input text object
	this.three = three; // input checkbox object
	this.four = four; // input radio object
	this.five = five;
	this.six = six;
	this.seven = seven;
	this.eight = eight;
	this.nine = nine;
	this.ten = ten;
}

/*
 * addRowToTable
 * Inserts at row 'num', or appends to the end if no arguments are passed in. Don't pass in empty strings.
 */
function addRowToTable2(num,TABLE,COLUMN,TYPE,ORG,VN,EN,CHECK)
{ 
	//alert(hasLoaded);
	if (hasLoaded && document.getElementById && document.getElementsByTagName) {

	 	//alert('ho tro dom');	
		var tbl = document.getElementById(TABLE_NAME);	
		var nextRow = tbl.tBodies[0].rows.length;		
		var iteration = nextRow + ROW_BASE;
		if (num == null) { 
			num = nextRow;
		} else {
			iteration = num + ROW_BASE;
		}
		// add the row		
		var row = tbl.tBodies[0].insertRow(num);		
		// CONFIG: requires classes named classy0 and classy1	
		//---------------------------------
		// Update 10/07/2008 --------------
		//---------------------------------
		//var cell_del = row.insertCell(0);
		//cell9.setAttribute('align','center');
		//cell_del.style.padding = '.0em 0px';
		//var btnDel = document.createElement('input');
		//btnDel.setAttribute('type', 'hidden');
		//btnDel.setAttribute('value', '');
		//btnDel.setAttribute('id','replacement_delete');
		//btnDel.onclick = function () {deleteCurrentRow(this)};
		//cell_del.appendChild(btnDel);
		
		var cell_edit = row.insertCell(0);
		//cell8.setAttribute('align','center');
		cell_edit.style.padding = '.0em 0px';
		var btnEdit = document.createElement('input');
		btnEdit.setAttribute('type', 'button');
		btnEdit.setAttribute('value', '     ');
		btnEdit.setAttribute('id','replacement_edit');
		btnEdit.onclick = function () {editCurrentRow(this)};
		cell_edit.appendChild(btnEdit);		
		
		//---------------------------------
		var cell0 = row.insertCell(1);
		//cell1.setAttribute('align','center');
		cell0.style.padding = '.0em 0px';
		var txtInp0 = document.createElement('input');
		txtInp0.setAttribute('type', 'text');
		txtInp0.setAttribute('style', 'text-align:center;');// style="text-align:right;"
		txtInp0.setAttribute('name', 'STT' + iteration);
		txtInp0.setAttribute('size', '4');
		txtInp0.setAttribute('value', iteration); // iteration included for debug purposes
		txtInp0.setAttribute('id', 'STT' + iteration);
		txtInp0.setAttribute('readOnly', true);
		cell0.appendChild(txtInp0);
		
		// cell 1 - input text
		var cell1 = row.insertCell(2);
		//cell1.setAttribute('align','center');
		cell1.style.padding = '.0em 0px';
		var txtInp1 = document.createElement('input');
		txtInp1.setAttribute('type', 'text');
		txtInp1.setAttribute('name', 'TABLE' + iteration);
		txtInp1.setAttribute('size', '15');
		txtInp1.setAttribute('value', TABLE); // iteration included for debug purposes
		txtInp1.setAttribute('title', TABLE);
		txtInp1.setAttribute('id', 'TABLE' + iteration);
		txtInp1.setAttribute('readOnly', true);
		cell1.appendChild(txtInp1);
				
		var cell2 = row.insertCell(3);
		//cell2.setAttribute('align','center');
		cell2.style.padding = '.0em 0px';
		var txtInp2 = document.createElement('input');
		txtInp2.setAttribute('type', 'text');
		txtInp2.setAttribute('name', 'COLUMN' + iteration);
		txtInp2.setAttribute('size', '10');
		txtInp2.setAttribute('value', COLUMN); // iteration included for debug purposes
		txtInp2.setAttribute('title', COLUMN);
		txtInp2.setAttribute('id', 'COLUMN' + iteration);
		txtInp2.setAttribute('readOnly', true);
		cell2.appendChild(txtInp2);
		
		var cell3 = row.insertCell(4);
		cell3.style.padding = '.0em 0px';
		var txtInp3 = document.createElement('input');
		txtInp3.setAttribute('name', 'TYPE' + iteration);
		txtInp0.setAttribute('style', 'text-align:center;');
		txtInp3.setAttribute('type', 'text');
		txtInp3.setAttribute('value', TYPE);
		txtInp3.setAttribute('title', TYPE);
		txtInp3.setAttribute('size', '12');
		txtInp3.setAttribute('readOnly', true);
		txtInp3.setAttribute('id', 'TYPE' + iteration);
		//txtInp3.className = 'textcenter';
		cell3.appendChild(txtInp3);
		
		var cell4 = row.insertCell(5);
		//cell4.setAttribute('align','center');
		cell4.style.padding = '.0em 0px';
		var txtInp4 = document.createElement('input');
		txtInp4.setAttribute('type', 'text');
		txtInp4.setAttribute('name', 'ORG' + iteration);
		txtInp4.setAttribute('size', '35');
		txtInp4.setAttribute('value', ORG); // iteration included for debug purposes
		txtInp4.setAttribute('title', ORG);
		txtInp4.setAttribute('readOnly', true);
		txtInp4.setAttribute('id', 'ORG' + iteration);
		cell4.appendChild(txtInp4);
		
		var cell5 = row.insertCell(6);
		//cell5.setAttribute('align','center');
		cell5.style.padding = '.0em 0px';
		var txtInp5 = document.createElement('input');
		txtInp5.setAttribute('type', 'text');
		txtInp5.setAttribute('name', 'VN' + iteration);
		txtInp5.setAttribute('size', '35');
		txtInp5.setAttribute('value', VN); // iteration included for debug purposes
		txtInp5.setAttribute('title', VN);
		txtInp5.setAttribute('readOnly', false);
		txtInp5.setAttribute('id', 'VN' + iteration);
		cell5.appendChild(txtInp5);
		
		var cell6 = row.insertCell(7);
		//cell5.setAttribute('align','center');
		cell6.style.padding = '.0em 0px';
		var txtInp6 = document.createElement('input');
		txtInp6.setAttribute('type', 'text');
		txtInp6.setAttribute('name', 'EN' + iteration);
		txtInp6.setAttribute('size', '35');
		txtInp6.setAttribute('value', EN); // iteration included for debug purposes
		txtInp6.setAttribute('title', EN);
		txtInp6.setAttribute('readOnly', false);
		txtInp6.setAttribute('id', 'EN' + iteration);
		cell6.appendChild(txtInp6);
		
		var cell7 = row.insertCell(8);
		//cell8.setAttribute('align','center');
		cell7.style.padding = '.0em 0px';
		var btnE2 = document.createElement('input');
		btnE2.setAttribute('type', 'button');
		btnE2.setAttribute('value', '     ');
		btnE2.setAttribute('id','replacement_edit');
		btnE2.onclick = function () {editCurrentRow(this)};
		cell7.appendChild(btnE2);
		
		var cell8 = row.insertCell(9);
		//cell9.setAttribute('align','center');
		cell8.style.padding = '.0em 0px';
		var btnE3 = document.createElement('input');
		btnE3.setAttribute('type', 'hidden');
		btnE3.setAttribute('value', '     ');
		btnE3.setAttribute('id','replacement_delete');
		btnE3.onclick = function () {deleteCurrentRow(this)};
		cell8.appendChild(btnE3);
		
		var cell9 = row.insertCell(10);
		cell9.setAttribute('align','center');
		cell9.style.padding = '.0em 0px';
		var txtInp7 = document.createElement('input');
		txtInp7.setAttribute('type', 'hidden');
		txtInp7.setAttribute('name', 'CHECK' + iteration);
		txtInp7.setAttribute('size', '0');
		txtInp7.setAttribute('value', CHECK); // iteration included for debug purposes
		txtInp7.setAttribute('title', CHECK);
		txtInp7.setAttribute('readOnly', true);
		txtInp7.setAttribute('id', 'CHECK' + iteration);
		cell9.appendChild(txtInp7);
		
		//		
		// Pass in the elements you want to reference later
		// Store the myRow object in each row
		row.myRow = new myRowObject(txtInp0, txtInp1, txtInp2, txtInp3, txtInp4, txtInp5, txtInp6, btnE2, btnE3, txtInp7);
		var textbox = document.getElementById('TOTAL');
		textbox.value = tbl.tBodies[0].rows.length;
	}
}

function addRowToTable3(num,TABLE,COLUMN,TYPE,ORG,VN,EN)
{ 
	//alert(hasLoaded);
	if (hasLoaded && document.getElementById && document.getElementsByTagName) {

	 	//alert('ho tro dom');	
		var tbl = document.getElementById(TABLE_NAME);	
		var nextRow = tbl.tBodies[0].rows.length;		
		var iteration = nextRow + ROW_BASE;
		if (num == null) { 
			num = nextRow;
		} else {
			iteration = num + ROW_BASE;
		}
		// add the row		
		var row = tbl.tBodies[0].insertRow(num);		
		// CONFIG: requires classes named classy0 and classy1	
		
		var cell_edit = row.insertCell(0);
		//cell8.setAttribute('align','center');
		cell_edit.style.padding = '.0em 0px';
		var btnEdit = document.createElement('input');
		btnEdit.setAttribute('type', 'button');
		btnEdit.setAttribute('value', '     ');
		btnEdit.setAttribute('id','replacement_edit');
		btnEdit.onclick = function () {editCurrentRow(this)};
		cell_edit.appendChild(btnEdit);		
		
		var cell0 = row.insertCell(1);
		//cell1.setAttribute('align','center');
		cell0.style.padding = '.0em 0px';
		var txtInp0 = document.createElement('input');
		txtInp0.setAttribute('type', 'text');
		txtInp0.setAttribute('style', 'text-align:center;');// style="text-align:right;"
		txtInp0.setAttribute('name', 'STT' + iteration);
		txtInp0.setAttribute('size', '4');
		txtInp0.setAttribute('value', iteration); // iteration included for debug purposes
		//txtInp0.setAttribute('title', STT);
		txtInp0.setAttribute('id', 'STT' + iteration);
		txtInp0.setAttribute('readOnly', true);
		cell0.appendChild(txtInp0);
		
		// cell 1 - input text
		var cell1 = row.insertCell(2);
		//cell1.setAttribute('align','center');
		cell1.style.padding = '.0em 0px';
		var txtInp1 = document.createElement('input');
		txtInp1.setAttribute('type', 'text');
		txtInp1.setAttribute('name', 'TABLE' + iteration);
		txtInp1.setAttribute('size', '15');
		txtInp1.setAttribute('value', TABLE); // iteration included for debug purposes
		txtInp1.setAttribute('title', TABLE);
		txtInp1.setAttribute('id', 'TABLE' + iteration);
		txtInp1.setAttribute('readOnly', true);
		cell1.appendChild(txtInp1);
				
		var cell2 = row.insertCell(3);
		//cell2.setAttribute('align','center');
		cell2.style.padding = '.0em 0px';
		var txtInp2 = document.createElement('input');
		txtInp2.setAttribute('type', 'text');
		txtInp2.setAttribute('style', 'text-align:left;');
		txtInp2.setAttribute('name', 'COLUMN' + iteration);
		txtInp2.setAttribute('size', '15');
		txtInp2.setAttribute('value', COLUMN); // iteration included for debug purposes
		txtInp2.setAttribute('title', COLUMN);
		txtInp2.setAttribute('id', 'COLUMN' + iteration);
		txtInp2.setAttribute('readOnly', true);
		cell2.appendChild(txtInp2);
		
		var cell3 = row.insertCell(4);
		cell3.style.padding = '.0em 0px';
		var txtInp3 = document.createElement('input');
		txtInp3.setAttribute('name', 'TYPE' + iteration);
		txtInp3.setAttribute('style', 'text-align:left;');
		txtInp3.setAttribute('type', 'text');
		txtInp3.setAttribute('value', TYPE);
		txtInp3.setAttribute('title', TYPE);
		txtInp3.setAttribute('size', '15');
		txtInp3.setAttribute('readOnly', true);
		txtInp3.setAttribute('id', 'TYPE' + iteration);
		//txtInp3.className = 'textcenter';
		cell3.appendChild(txtInp3);
		
		var cell4 = row.insertCell(5);
		//cell4.setAttribute('align','center');
		cell4.style.padding = '.0em 0px';
		var txtInp4 = document.createElement('input');
		txtInp4.setAttribute('type', 'text');
		txtInp4.setAttribute('name', 'ORG' + iteration);
		txtInp4.setAttribute('size', '20');
		txtInp4.setAttribute('value', ORG); // iteration included for debug purposes
		txtInp4.setAttribute('title', ORG);
		txtInp4.setAttribute('readOnly', true);
		txtInp4.setAttribute('id', 'ORG' + iteration);
		cell4.appendChild(txtInp4);
		
		var cell5 = row.insertCell(6);
		//cell5.setAttribute('align','center');
		cell5.style.padding = '.0em 0px';
		var txtInp5 = document.createElement('input');
		txtInp5.setAttribute('type', 'text');
		txtInp5.setAttribute('name', 'VN' + iteration);
		txtInp5.setAttribute('size', '20');
		txtInp5.setAttribute('value', VN); // iteration included for debug purposes
		txtInp5.setAttribute('title', VN);
		txtInp5.setAttribute('readOnly', false);
		txtInp5.setAttribute('id', 'VN' + iteration);
		cell5.appendChild(txtInp5);
		
		var cell6 = row.insertCell(7);
		//cell5.setAttribute('align','center');
		cell6.style.padding = '.0em 0px';
		var txtInp6 = document.createElement('input');
		txtInp6.setAttribute('type', 'text');
		txtInp6.setAttribute('name', 'EN' + iteration);
		txtInp6.setAttribute('size', '20');
		txtInp6.setAttribute('value', EN); // iteration included for debug purposes
		txtInp6.setAttribute('title', EN);
		txtInp6.setAttribute('readOnly', false);
		txtInp6.setAttribute('id', 'EN' + iteration);
		cell6.appendChild(txtInp6);
		
		var cell7 = row.insertCell(8);
		//cell8.setAttribute('align','center');
		cell7.style.padding = '.0em 0px';
		var btnE2 = document.createElement('input');
		btnE2.setAttribute('type', 'button');
		btnE2.setAttribute('value', '     ');
		btnE2.setAttribute('id','replacement_edit');
		btnE2.onclick = function () {editCurrentRow(this)};
		cell7.appendChild(btnE2);
			
		//		
		// Pass in the elements you want to reference later
		// Store the myRow object in each row
		row.myRow = new myRowObject(txtInp0, txtInp1, txtInp2, txtInp3, txtInp4, txtInp5, txtInp6, btnE2);
		var textbox = document.getElementById('TOTAL');
		textbox.value = tbl.tBodies[0].rows.length;
	}
}

function deleteCurrentRow(obj)
{
	//alert('vao ham');
	if (hasLoaded) {
		var delRow = obj.parentNode.parentNode;
		var tbl = delRow.parentNode.parentNode;
		var rIndex = delRow.sectionRowIndex;
		var rowArray = new Array(delRow);
		deleteRows(rowArray);
		reorderRows(tbl, rIndex);
	}
}

function setSelected(index){
	try{		
		var tbl = document.getElementById(TABLE_NAME);	
		var i, j;
		var rows = tbl.tBodies[0].rows.length;		
		//var cells = tbl.tBodies[0].rows[index].cells.length;		
		for(i=1;i<=rows;i++){							
			document.getElementById("STT"+i).style.backgroundColor='';
			document.getElementById("TABLE"+i).style.backgroundColor='';
			document.getElementById("COLUMN"+i).style.backgroundColor='';
			document.getElementById("TYPE"+i).style.backgroundColor='';
			document.getElementById("ORG"+i).style.backgroundColor='';
			document.getElementById("VN"+i).style.backgroundColor='';
			document.getElementById("EN"+i).style.backgroundColor='';
				
		}				
			//--------------------------------------------
			
			document.getElementById("STT"+(index+1)).style.backgroundColor='#FFFFCC';
			document.getElementById("TABLE"+(index+1)).style.backgroundColor='#FFFFCC';
			document.getElementById("COLUMN"+(index+1)).style.backgroundColor='#FFFFCC';
			document.getElementById("TYPE"+(index+1)).style.backgroundColor='#FFFFCC';
			document.getElementById("ORG"+(index+1)).style.backgroundColor='#FFFFCC';
			document.getElementById("VN"+(index+1)).style.backgroundColor='#FFFFCC';
			document.getElementById("EN"+(index+1)).style.backgroundColor='#FFFFCC';
		
	}catch(ex){
		
	}	
}

function editCurrentRow(obj)
{	
	//alert('vao ham edit');
	var capnhat = document.getElementById('capnhatbctc');
	//var themmoi = document.getElementById('themmoibctc');
	if(capnhat){
		capnhat.disabled = false;
		//themmoi.disabled = true;
		var thisRow = obj.parentNode.parentNode;
		var tbl = thisRow.parentNode.parentNode;
		var rIndex = thisRow.sectionRowIndex;
		curr_row = rIndex;
		setSelected(rIndex);
		
		var TABLE =  document.getElementById("TABLE");
		var COLUMN =  document.getElementById("COLUMN");
		var TYPE =  document.getElementById("TYPE");
		var ORG =  document.getElementById("ORG");
		var VN =  document.getElementById("VN");
		var EN =  document.getElementById("EN");
		
		if(TABLE){
			TABLE.value = tbl.tBodies[0].rows[rIndex].myRow.two.value;
			COLUMN.value = tbl.tBodies[0].rows[rIndex].myRow.three.value;
						
			TYPE.value = tbl.tBodies[0].rows[rIndex].myRow.four.value;			
			ORG.value = tbl.tBodies[0].rows[rIndex].myRow.five.value;
			
			VN.value = tbl.tBodies[0].rows[rIndex].myRow.six.value;
			//tbl.tBodies[0].rows[rIndex].myRow.six.readOnly = false;
			EN.value = tbl.tBodies[0].rows[rIndex].myRow.seven.value;
			//tbl.tBodies[0].rows[rIndex].myRow.seven.readOnly = false;	
			tbl.tBodies[0].rows[rIndex].myRow.ten.value = 'Y';		
		}
	}
	
}

function reorderRows(tbl, startingIndex)
{
	if (hasLoaded) {	
		var textbox = document.getElementById('TOTAL');
		textbox.value = tbl.tBodies[0].rows.length;
		//alert(tbl.tBodies[0].rows.length);
		if (tbl.rows[startingIndex]) {
			var count = startingIndex + ROW_BASE;
			for (var i=startingIndex; i<tbl.tBodies[0].rows.length; i++) {			
				// CONFIG: next line is affected by myRowObject settings
				tbl.tBodies[0].rows[i].myRow.one.name = 'STT' + count; // text				
				tbl.tBodies[0].rows[i].myRow.one.id = 'STT' + count; // text				
				tbl.tBodies[0].rows[i].myRow.one.value = count; // text				
				// CONFIG: next line is affected by myRowObject settings
				tbl.tBodies[0].rows[i].myRow.two.name = 'TABLE' + count; // input text
				tbl.tBodies[0].rows[i].myRow.three.name = 'COLUMN' + count; // input text
				tbl.tBodies[0].rows[i].myRow.four.name = 'TYPE' + count; // input text
				tbl.tBodies[0].rows[i].myRow.five.name = 'ORG' + count; // input text
				tbl.tBodies[0].rows[i].myRow.six.name = 'VN' + count; // input text
				tbl.tBodies[0].rows[i].myRow.seven.name = 'EN' + count; // input text
		
				tbl.tBodies[0].rows[i].myRow.two.id = 'TABLE' + count; // input text
				tbl.tBodies[0].rows[i].myRow.three.id = 'COLUMN' + count; // input text
				tbl.tBodies[0].rows[i].myRow.four.id = 'TYPE' + count; // input text
				tbl.tBodies[0].rows[i].myRow.five.id = 'ORG' + count; // input text
				tbl.tBodies[0].rows[i].myRow.six.id = 'VN' + count; // input text
				tbl.tBodies[0].rows[i].myRow.seven.id = 'EN' + count; // input text
				count++;
			}
		}
	}

}

function deleteRows(rowObjArray)
{
	if (hasLoaded) {
		//alert(rowObjArray + ' - ' + rowObjArray.length);
		for (var i=0; i<rowObjArray.length; i++) {
			var rIndex = rowObjArray[i].sectionRowIndex;
			rowObjArray[i].parentNode.deleteRow(rIndex);			
		}
		//var tbl = document.getElementById(TABLE_NAME);
		///reorderRows(tbl,0);
		document.getElementById("TABLE").value = "";
		document.getElementById("COLUMN").value = "";
		document.getElementById("TYPE").value = "";
		document.getElementById("ORG").value = "";
		document.getElementById("VN").value = "";
		document.getElementById("EN").value = "";
		document.getElementById("CHECK").value = "";
		var capnhat = document.getElementById("capnhatbctc");
		if(capnhat){
			capnhat.disabled = true;
			//themmoi.disabled = false;
		}
	}	
}

function openInNewWindow(frm)
{
	// open a blank window
	var aWindow = window.open('', 'TableAddRow2NewWindow',
	'scrollbars=yes,menubar=yes,resizable=yes,toolbar=no,width=400,height=400');
	
	// set the target to the blank window
	frm.target = 'TableAddRow2NewWindow';
	
	// submit
	frm.submit();
}

function delallrow(moduleTable,l) {
len = l;
	for (i = len -1; i != 0; i--) {
	
		moduleTable.deleteRow(i);
	
	}
}

/*
function openwindow(form, index){
	mywindow = window.open('microbank_id.php?name=ACCTNO' + index+ '-CURCODE' + index, 'mywindow','menubar=0,resizable=yes,width=800,height=300, scrollbars=yes');
	mywindow.moveTo((screen.width-800)/2,screen.height/2);
	
	//window.open('microbank_id.php?name=ACCTNO' + index + '-CURCODE' + index);
}*/

function addRow(){	
		var TABLE =  document.getElementById("TABLE");
		var COLUMN =  document.getElementById("COLUMN");
		var TYPE =  document.getElementById("TYPE");
		var ORG =  document.getElementById("ORG");
		var VN =  document.getElementById("VN");
		var EN =  document.getElementById("EN");
		var CHECK =  document.getElementById("CHECK");
		
	if(TABLE){	
		if(TABLE.value){
			addRowToTable2(null,TABLE.value,COLUMN.value,TYPE.value,ORG.value,VN.value,EN.value,CHECK.value);
			TABLE.value = "";
			COLUMN.value = "";
			TYPE.value = "";
			ORG.value = "";
			VN.value = "";
			EN.value = "";
			CHECK.value = "";
		}
	}
}

function updateRow(){
	var capnhat = document.getElementById("capnhatbctc");
	//var themmoi = document.getElementById("themmoibctc");
	if(capnhat){
		capnhat.disabled = true;
		//themmoi.disabled = false;
		var tbl = document.getElementById(TABLE_NAME);
		rIndex = curr_row;
		if(rIndex>=0){
			var TABLE =  document.getElementById("TABLE");
			var COLUMN =  document.getElementById("COLUMN");
			var TYPE =  document.getElementById("TYPE");
			var ORG =  document.getElementById("ORG");
			var VN =  document.getElementById("VN");
			var EN =  document.getElementById("EN");
			var CHECK =  document.getElementById("CHECK");
			
			if(TABLE){
				if(TABLE.value){
				//CONFIG: next line is affected by myRowObject settings
				tbl.tBodies[0].rows[rIndex].myRow.two.value = TABLE.value; // input text
				tbl.tBodies[0].rows[rIndex].myRow.three.value = COLUMN.value; // input text
				tbl.tBodies[0].rows[rIndex].myRow.four.value = TYPE.value; // input text
				tbl.tBodies[0].rows[rIndex].myRow.five.value = ORG.value; // input text
				tbl.tBodies[0].rows[rIndex].myRow.six.value = VN.value; // input text
				tbl.tBodies[0].rows[rIndex].myRow.seven.value = EN.value; // input text		
				tbl.tBodies[0].rows[rIndex].myRow.ten.value = 'Y'; // input text	
							
				TABLE.value = "";
				COLUMN.value = "";
				TYPE.value = "";
				ORG.value = "";
				VN.value = "";
				EN.value = "";
				CHECK.value = "";
				}
			}
		}
	}
}